package com.example.lzy.activitystartupshutdown.Page_pass_value;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;

import com.example.lzy.activitystartupshutdown.R;

public class Main3Activity extends AppCompatActivity {

    private Button mRegsiterBtn = null;

    private EditText mNameEt = null;
    private RadioButton mNan = null;
    private RadioButton mNv = null;

    private EditText mPasswordEt = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);


        mRegsiterBtn = (Button) findViewById(R.id.regsit_btn);
        mNameEt = (EditText) findViewById(R.id.name_et);
        mNan = (RadioButton) findViewById(R.id.nan_rb);
        mNv = (RadioButton) findViewById(R.id.nv_rb);
        mPasswordEt = (EditText) findViewById(R.id.name_pwd);

        mRegsiterBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                regsiter();
            }


        });
    }
    private void regsiter() {

        Intent i = new Intent(this,Main4Activity.class);

        i.putExtra("name",mNameEt.getText().toString().trim());
        i.putExtra("pwd",mPasswordEt.getText().toString().trim());

        String ste = "";

        if (mNan.isChecked()){
            ste = "男";
        }else if (mNv.isChecked()){
            ste = "女";
        }


        i.putExtra("sex",ste);
        startActivity(i);

    }
}
